package com.corejsf;

import java.io.Serializable;

@SuppressWarnings("serial")
/**
 * Worksheet object that holds a row of a worksheet.
 * @author Jitin Dhillon, Kelton Kowalchuk
 *
 */
public class WorkSheet implements Serializable {
	/**
	 * Project id.
	 */
	private int project;
	/**
	 * Work package.
	 */
	private String wp;
	/**
	 * Hours total.
	 */
	private double total;
	/**
	 * Hours for Saturday.
	 */
	private double sat;
	/**
	 * Hours for Sunday.
	 */
	private double sun;
	/**
	 * Hours for Monday.
	 */
	private double mon;
	/**
	 * Hours for Tuesday.
	 */
	private double tue;
	/**
	 * Hours for Wednesday.
	 */
	private double wed;
	/**
	 * Hours for Thursday.
	 */
	private double thu;
	/**
	 * Hours for Friday.
	 */
	private double fri;
	/**
	 * Notes for the week.
	 */
	private String notes;
	/**
	 * Boolean for if the row is editable.
	 */
	private boolean editable;
	private int rowID;
	/**
	 * Consturctor for worksheet.
	 * @param project Project Name
	 * @param wp Work Package
	 * @param total Total Hours
	 * @param sat Saturday Hours	
	 * @param sun Sunday Hours	
	 * @param mon Monday Hours
	 * @param tue Tuesday Hours
	 * @param wed Wednesday Hours
	 * @param thu Thursday Hours
	 * @param fri Friday Hours
	 * @param notes Notes for Work Package
	 * @param editable if editable in the view.
	 */
	public WorkSheet(int project, String wp, double sat,
			double sun, double mon, double tue, double wed, double thu,
			double fri, String notes, boolean editable, int rowID) {
		super();
		this.project = project;
		this.wp = wp;
		this.total += sat + sun + mon + tue + wed + thu + fri;
		this.sat = sat;
		this.sun = sun;
		this.mon = mon;
		this.tue = tue;
		this.wed = wed;
		this.thu = thu;
		this.fri = fri;
		this.notes = notes;
		this.editable = editable;
		this.rowID = rowID;
	}
	
	/**
	 * Method to calculate the totals for the worksheet footers and total column.
	 */
	public void calcTotal(){
		this.total = sat + sun + mon + tue + wed + thu + fri;
	}

	public int getProject() { return project; }
	public void setProject(int project) { this.project = project; }

	public String getWp() {	return wp; }
	public void setWp(String wp) { this.wp = wp; }

	public double getTotal() { return total; }
	public void setTotal(double total) { this.total = total; }

	public double getSat() { return sat; }
	public void setSat(double sat) { this.sat = sat; }

	public double getSun() { return sun; }
	public void setSun(double sun) { this.sun = sun; }

	public double getMon() { return mon; }
	public void setMon(double mon) { this.mon = mon; }

	public double getTue() { return tue; }
	public void setTue(double tue) { this.tue = tue; }

	public double getWed() { return wed; }
	public void setWed(double wed) { this.wed = wed; }

	public double getThu() { return thu; }
	public void setThu(double thu) { this.thu = thu; }

	public double getFri() { return fri; }
	public void setFri(double fri) { this.fri = fri; }

	public String getNotes() { return notes; }
	public void setNotes(String notes) { this.notes = notes; }

	public boolean isEditable() { return editable; }
	public void setEditable(boolean newValue) {	editable = newValue; }

	public int getRowID() { return rowID; }
	public void setRowID(int rowID) { this.rowID = rowID; }
}